// status.js
var iconUrl = require('../../config.js').iconUrl;
var net=require('../../utils/net.js');
Page({
  mineinfo:function(){    
      wx.navigateTo({
        url: '/pages/mineinfo/mineinfo',
        success:function(res){            
        }
      })
  },
  binddevice:function(){
    wx.navigateTo({
      url: '/pages/search/search?page=3',
    })
  },
  minezan:function(){    
    wx.navigateTo({
      url: '/pages/minezan/minezan',
    })
  },
  about:function(){
    wx.navigateTo({
      url: '/pages/about/about',
    })
  },
  protocol:function(){
    wx.navigateTo({
      url: '/pages/protocol/protocol',
    })
  },
  feedback:function(){
    wx.navigateTo({
      url: '/pages/feedback/feedback',
    })
  },
  /**
   * 页面的初始数据
   */
  data: {
    iconUrl: iconUrl,
     zancount:0,
    userinfo:'',
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
      this.onPullDownRefresh();
  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {

  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {

  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function () {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function () {

  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {
    var that=this;
    
    that.setData({
      userinfo: wx.getStorageSync("userinfo"),
    });
    net.receive_likes(
      function(data){
           if(data.flag){
              var data=data.data;
              that.setData({
                 "zancount":data.length
              });
              wx.setStorageSync("zanlist", data)
           }else{
             wx.showToast({
               title: data.msg,
             })
           }
      }
    );
  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {

  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {

  }
})